Requires Scripting PRO
The ControlWidget API enables users to add custom Button or Toggle controls to the iOS Control Center or Lock Screen. Each control is linked to an AppIntent to execute custom script logic. The controls support privacy protection, dynamic state labels, and SFSymbols icons.
ControlWidgetLabelRepresents a label for a control, including the main label or value label in active/inactive state.
| Property | Type | Description |
|---|---|---|
title |
string |
The main title of the label. |
systemImage |
string? |
Optional SFSymbol image name for the label. |
privacySensitive |
boolean? |
If true, the label content is hidden when the device is locked. |
ControlWidgetButtonRenders a button control that executes a script intent when tapped.
ControlWidgetButtonProps| Property | Type | Description |
|---|---|---|
privacySensitive |
boolean? |
If true, the control's state and content are hidden when the device is locked. |
intent |
AppIntent<any> |
The intent to be executed when the button is tapped. |
label |
ControlWidgetLabel |
The main label shown on the button. |
activeValueLabel |
ControlWidgetLabel | null? |
The label shown when the button is active. Must be paired with inactiveValueLabel. Overrides systemImage in label. |
inactiveValueLabel |
ControlWidgetLabel | null? |
The label shown when the button is inactive. Must be paired with activeValueLabel. Overrides systemImage in label. |
If either
activeValueLabelorinactiveValueLabelis provided, both should be specified to ensure proper state display.
ControlWidgetToggleRenders a toggle control that updates a boolean value using a script intent.
ControlWidgetToggleProps<T>| Property | Type | Description |
|---|---|---|
privacySensitive |
boolean? |
If true, the control's state and content are hidden when the device is locked. |
intent |
AppIntent<T> |
The intent to execute when toggled. The type T must extend { value: boolean }. |
label |
ControlWidgetLabel |
The main label for the toggle. |
activeValueLabel |
ControlWidgetLabel | null? |
Label displayed when toggle is ON. Must be paired with inactiveValueLabel. |
inactiveValueLabel |
ControlWidgetLabel | null? |
Label displayed when toggle is OFF. Must be paired with activeValueLabel. |
ControlWidget NamespaceControlWidget.parameter: stringA user-defined string parameter set during control configuration. Useful for targeting specific resources (e.g., a device ID or door ID).
ControlWidget.present(element: VirtualNode): voidDisplays the control UI. Only ControlWidgetButton or ControlWidgetToggle elements are supported.
control_widget_button.tsx must only render a ControlWidgetButton.control_widget_toggle.tsx must only render a ControlWidgetToggle.privacySensitive on the root.privacySensitive inside ControlWidgetLabel.ControlWidget.reloadButtons(): voidReloads all control widget buttons. Useful when the intent result changes the UI state.
ControlWidget.reloadToggles(): voidReloads all toggle widgets. Call this after a toggle action to update state.
AppIntent to define its behavior.{ value: boolean }.activeValueLabel / inactiveValueLabel), always provide both.systemImage) should follow SF Symbols naming conventions.ControlWidget.reloadButtons() and reloadToggles() to force UI updates after state changes in the background.